#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>

void display(unsigned int num);
void output(uint8_t digit);

int main()
{
	unsigned int num = 0;
	printf("input a number:");
	scanf("%d", &num);
	display(num);
	return 0;
}

void display(unsigned int num)
{
	uint8_t digit_num = 1;
	unsigned int num_cp = num;
	while(num_cp = num_cp / 10)digit_num++;
	//printf("digit_num:%d", digit_num);
	int i;
	num_cp = num;
	for(i = digit_num; i > 0; i--)
	{
		output(num_cp/((int)pow(10, i-1))%10);
		num_cp = num;
	}
	putchar('\n');
}

void output(uint8_t digit)
{
	switch (digit)
	{
		case 0:
			printf("zero ");
			break;
		case 1:
			printf("one ");
			break;
		case 2:
			printf("two ");
			break;
		case 3:
			printf("three ");
			break;
		case 4:
			printf("four ");
			break;
		case 5:
			printf("five ");
			break;
		case 6:
			printf("six ");
			break;
		case 7:
			printf("seven ");
			break;
		case 8:
			printf("eight ");
			break;
		case 9:
			printf("nine ");
			break;
	}
}
